package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;

@RestController
public class TestController {
    @Autowired
    private DataSource dataSource;

    @GetMapping("/datasource")
    public String showDataSource() {
        return "当前数据源: " + dataSource.getClass().getName();
    }
}